import { createVNode, render } from 'vue'
import UbtMsg from './UbtMsg.vue'

const msgMain = document.createElement('div')
document.body.appendChild(msgMain)
 
let showTime = null
export default ({kind, txt}) => {
  const msgNode = createVNode(UbtMsg, {kind, txt})
  render(msgNode, msgMain)
  clearTimeout(showTime)
  showTime = setTimeout(() => {
    render(null, msgMain)
  }, 3000)
}
